package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot.UltrasonicService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: UltrasonicController
 * @Date: Created in 17:18 2022/10/10
 * @Description:
 */
@Action
@RequestMapping(value="fireFightingIOT/ultrasonic")
public class UltrasonicController extends BaseController {

    @Resource
    private UltrasonicService ultrasonicService;

    /**
     * @Author YangYu
     * @Description 组新增、编辑
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "groupAddOrUpdate", method = RequestMethod.POST)
    public RespEntity groupAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.groupAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 组删除
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "groupDel", method = RequestMethod.POST,param = {"id"})
    public RespEntity groupDel(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.groupDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 组列表
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "groupList", method = RequestMethod.GET)
    public RespEntity groupList(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.groupList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 超声波设备新增、编辑
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "ultrasonicDeviceAddOrUpdate", method = RequestMethod.POST)
    public RespEntity ultrasonicDeviceAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.ultrasonicDeviceAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 超声波设备删除
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "ultrasonicDeviceDel", method = RequestMethod.POST,param = {"id"})
    public RespEntity ultrasonicDeviceDel(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.ultrasonicDeviceDel(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 超声波设备删除
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "ultrasonicDeviceDetail", method = RequestMethod.GET,param = {"id"})
    public RespEntity ultrasonicDeviceDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.ultrasonicDeviceDetail(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 超声波设备分页列表
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "ultrasonicDeviceListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity ultrasonicDeviceListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.ultrasonicDeviceListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 超声波水表数据分页列表
     * @Date Created in 17:19 2022/10/10
     * @Param [jsonParam]
     */

    @At(value = "ultrasonicDeviceNormalLogListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity ultrasonicDeviceNormalLogListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return ultrasonicService.ultrasonicDeviceNormalLogListPage(jsonParam);
    }
}
